<template>
	<view class="">
		<view class="between record-item" v-for="(item,index) in list" :key="index">
			<view class="">
				<view class="fw-b">{{item.status == 1?'核销成功': '核销失败'}}</view>
				<view class="record-item--time">{{ item.updated_at }}</view>
			</view>
			<view class="">
				<text class="record-item--num">{{ item.times }}</text>
				<text class="record-item--util gray">/次</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				shop_id: '',
				id: '',
			}
		},
		onLoad(e) {
			this.id = e.id;
			this.shop_id = uni.getStorageSync('shopId');
		},
		onShow() {
			this.getWriteOff();
		},
		methods: {
			async getWriteOff() {
				let res = await this.$api.get('staff/check/log');
				if(res.code == 200) {
					this.last_page = parseInt(res.data.to)/parseInt(res.data.per_page);
					if(this.page == 1) {
						this.list = res.data.data;
					}else {
						this.list.push(...res.data.data);
					}
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.record-item {
		padding: 28rpx 32rpx;
		background-color: #FFF;
		border-bottom: 1rpx solid #F7F7F7;
		font-size: 27rpx;
		&--time {
			color: #B3B3B3;
			font-size: 24rpx;
			margin-top: 8rpx;
		}
		&--num {
			font-size: 32rpx;
			font-weight: bold;
		}
		&--util {
			font-size: 20rpx;
		}
	}
	.record-item:first-child {
		margin-top: 20rpx;
	}
</style>